package factory.store;

import factory.pizza.Pizza;

public abstract class PizzaStore {

    // 订购披萨
    public Pizza orderPizza(String type) {
        Pizza pizza;
        pizza = createPizza(type);

        pizza.prepare();
        pizza.bake();
        pizza.cut();
        pizza.box();

        return pizza;
    }

    // 创建披萨 因为每家店面（工厂）可能生产的步骤不一样 因此交给子类实现 由子类决定创建具体哪种类型的披萨
    protected abstract Pizza createPizza(String type);
}
